<?php
class Sector extends AppModel {
	var $name = 'Sector';
	var $belongsTo = array(
		'Comuna' => array(
			'className' => 'Comuna',
			'foreignKey' => 'comuna_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
	var $hasMany = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'sector_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'Grupo' => array(
			'className' => 'Grupo',
			'foreignKey' => 'sector_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);
	var $validate = array(
		'comuna_id'=> array(
						'rule' 		=> 	'notEmpty',
						'required' 		=> 	true,
						'message' 	=>	'El identificador de Comuna no puede ser núlo.'
					)		
	);
}
?>